package com.cyd.order_service.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * json工具类
 */
public class JsonUtils {

    private static final ObjectMapper objectMapper=new ObjectMapper();

    /**
     * JSON字符串转JSONODE对象方法
     */
    public static JsonNode str2JsonNode(String str){
        try {
            return objectMapper.readTree(str);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            return null;
        }
    }

}
